<template>
  <div>
 <h2>会员列表1</h2>
 <hr>
 姓名:<input type="text" v-model="state.Name">
 手机号:<input type="text" v-model="state.Phone">
 <br>
 身份证号:<input type="text" v-model="state.SFZ">
 会员卡号:<input type="text" v-model="state.KH">
  <input type="button" value="查询" @click="MemberShow">
 <table border="1">
  <tr>
    <td>会员类型</td>
    <td>姓名</td>
    <td>手机号</td>
    <td>生日</td>
    <td>会员等级</td>
    <td>积分</td>
    <td>会员卡号</td>
    <td>登记时间</td>
    <td>操作</td>
  </tr>
  <tr v-for="item in list">
    <td>{{item.type}}</td>
    <td>{{item.name}}</td>
    <td>{{item.phone}}</td>
    <td>{{item.sr}}</td>
    <td>{{item.dj}}</td>
    <td>{{item.jf}}</td>
    <td>{{item.kh}}</td>
    <td>{{item.cTime}}</td>
    <td>
      <input type="button" value="编辑">
      <input type="button" value="删除">
      <input type="button" value="状态">

    </td>
  </tr>
 </table>

  </div>
</template>

<script setup lang="ts">
import { reactive, toRefs, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import axios from 'axios';

const router = useRouter();
const route = useRoute();

let data:any=reactive({
  state:{
    Name:'',
    Phone:'',
    SFZ:'',
    KH:''

  },

  list:[]
})

let {state,list}=toRefs(data);
onMounted(()=>{
  MemberShow()
})

function MemberShow()
{
     var obj={
      Name:state.value.Name,
      Phone:state.value.Phone,
      SFZ:state.value.SFZ,
      KH:state.value.KH
     }
  axios({
    url:'https://localhost:7278/api/Member/MemberShow',
    method:'get',
    params:obj
  })
  .then(res=>{
   list.value=res.data.data
  })
  .catch(err=>{
    console.log(err)
  })


}






</script>

<style scoped>

</style>